// 匹配views里面所有的.vue文件
const modules = import.meta.glob('./../views/**/*.vue');

function loadView(view) {
    for (const path in modules) {
        const dir = path.split('views/')[1].split('.vue')[0];
        if (dir === view) {
            return () => modules[path]();
        }
    }
}

export default {
    loadView
}